namespace OneWorks.Utils.FluentData
{
    internal abstract class BaseDeleteBuilder
    {
        public BuilderData Data { get; set; }
        protected ActionsHandler Actions { get; set; }

        public BaseDeleteBuilder(IDbCommand command, string name)
        {
            this.Data =  new BuilderData(command, name);
            this.Actions = new ActionsHandler(this.Data);
        }

        public int Execute()
        {
            this.Data.Command.Sql(this.Data.Command.Data.Context.Data.Provider.GetSqlForDeleteBuilder(this.Data));			

            return this.Data.Command.Execute();
        }
    }
}